#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
int main()
{
	int i = 0;
	int j = 0;
	char c = 0;
	char ch[20] = { 0 };
	gets_s(ch);
	for (i = 0;(c = ch[i]) != '\0';i++)
	{
		if (c == ' '&&ch[i+1]!=' ')
		{
			j++;
		}
	}
	j++;
	printf("%d", j);
}